
Setting environment for using XAMPP for Windows.

cubes@CUBES-PC c:\xampp
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.27 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| b15                |
| cdcol              |
| cubes              |
| express            |
| joomla             |
| mb120              |
| mb125              |
| mb126              |
| mysql              |
| nb158e             |
| nb158f             |
| nb158i             |
| performance_schema |
| phpcubes           |
| phpmyadmin         |
| plaincart          |
| printbot_db        |
| shop_script        |
| test               |
| webauth            |
| zf2                |
| zf_tutorial        |
+--------------------+
23 rows in set (0.40 sec)

mysql> CREATE DATABASE `nb158ij`;
Query OK, 1 row affected (0.06 sec)

mysql> USE `nb158ij`;
Database changed
mysql> SHOW TABLES;
Empty set (0.00 sec)

mysql> CREATE TABLE `users`(
    -> `id` INT AUTO_INCREMENT PRIMARY KEY,
    -> `name` VARCHAR(255),
    -> `email` VARCHAR(255),
    -> `password` CHAR(32),
    -> `added_date` DATETIME,
    -> `modified_date` TIMESTAMP,
    -> `status` ENUM('0','1')
    -> );
Query OK, 0 rows affected (1.83 sec)

mysql> CREATE TABLE `users1`(
    -> name VARCHAR2(123));
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the r
ight syntax to use near 'VARCHAR2(123))' at line 2
mysql> CREATE TABLE `users1`(
    -> `name` VARCHAR(255));
Query OK, 0 rows affected (0.13 sec)

mysql> DROP users1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the r
ight syntax to use near 'users1' at line 1
mysql> DROP TABLE users1;
Query OK, 0 rows affected (0.09 sec)

mysql> SHOW TABLES:
    -> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the r
ight syntax to use near ':' at line 1
mysql> SHOW TABLES;
+-------------------+
| Tables_in_nb158ij |
+-------------------+
| users             |
+-------------------+
1 row in set (0.00 sec)

mysql> DESC `users`;
+---------------+---------------+------+-----+-------------------+-----------------------------+
| Field         | Type          | Null | Key | Default           | Extra                       |
+---------------+---------------+------+-----+-------------------+-----------------------------+
| id            | int(11)       | NO   | PRI | NULL              | auto_increment              |
| name          | varchar(255)  | YES  |     | NULL              |                             |
| email         | varchar(255)  | YES  |     | NULL              |                             |
| password      | char(32)      | YES  |     | NULL              |                             |
| added_date    | datetime      | YES  |     | NULL              |                             |
| modified_date | timestamp     | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| status        | enum('0','1') | YES  |     | NULL              |                             |
+---------------+---------------+------+-----+-------------------+-----------------------------+
7 rows in set (0.09 sec)

mysql> INSERT INTO `users` VALUES (
    -> NULL,'Rasmus Lerdorf','zeev@gmaail.com','1q1q1q',NOW(),NULL,'1'
    -> );
Query OK, 1 row affected (0.08 sec)

mysql> INSERT INTO `users` VALUES
    -> (
    -> NULL,
    -> 'Vikas Dwivedi',
    -> 'vikas.nice@gmail.com',
    -> '1q1q1q',
    -> NOW(),
    -> NULL,
    -> '0'
    -> );
Query OK, 1 row affected (0.08 sec)

mysql> SELECT * FROM `users`;
+----+----------------+----------------------+----------+---------------------+---------------------+--------+
| id | name           | email                | password | added_date          | modified_date       | status |
+----+----------------+----------------------+----------+---------------------+---------------------+--------+
|  1 | Rasmus Lerdorf | zeev@gmaail.com      | 1q1q1q   | 2014-03-28 10:54:55 | 2014-03-28 10:54:55 | 1      |
|  2 | Vikas Dwivedi  | vikas.nice@gmail.com | 1q1q1q   | 2014-03-28 10:56:06 | 2014-03-28 10:56:06 | 0      |
+----+----------------+----------------------+----------+---------------------+---------------------+--------+
2 rows in set (0.00 sec)

mysql> INSERT INTO `users`
    -> (`status`,`added_date`,`name`,`password`,`email`)
    -> VALUES
    -> ('1',NOW(),'Ramesh Rajwar','pass@123','ram@gmail.com');
Query OK, 1 row affected (1.70 sec)

mysql> INSERT INTO `users`SET
    -> name = 'Ravi Shankar',
    -> email = 'powerofravi@gmail.com',
    -> password' = 'pass@345',
    '> Byeed_date

cubes@CUBES-PC c:\xampp
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.27 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use nb158ij;
Database changed
mysql> show tables;
+-------------------+
| Tables_in_nb158ij |
+-------------------+
| users             |
+-------------------+
1 row in set (0.00 sec)

mysql> INSERT INTO `users` SET
    -> name = 'Ravi Shankar',
    -> email = 'ravi@gmail.com',
    -> password = 'qwerty',
    -> added_date = NOW(),
    -> status = '1';
Query OK, 1 row affected (0.09 sec)

mysql> SELECT * FROM `users`;
+----+----------------+----------------------+----------+---------------------+---------------------+--------+
| id | name           | email                | password | added_date          | modified_date       | status |
+----+----------------+----------------------+----------+---------------------+---------------------+--------+
|  1 | Rasmus Lerdorf | zeev@gmaail.com      | 1q1q1q   | 2014-03-28 10:54:55 | 2014-03-28 10:54:55 | 1      |
|  2 | Vikas Dwivedi  | vikas.nice@gmail.com | 1q1q1q   | 2014-03-28 10:56:06 | 2014-03-28 10:56:06 | 0      |
|  3 | Ramesh Rajwar  | ram@gmail.com        | pass@123 | 2014-03-28 11:00:38 | 2014-03-28 11:00:38 | 1      |
|  4 | Ravi Shankar   | ravi@gmail.com       | qwerty   | 2014-03-28 11:04:36 | 2014-03-28 11:04:36 | 1      |
+----+----------------+----------------------+----------+---------------------+---------------------+--------+
4 rows in set (0.00 sec)

mysql> UPDATE `users` SET `password` = 'cheers!!';
Query OK, 4 rows affected (1.70 sec)
Rows matched: 4  Changed: 4  Warnings: 0

mysql> SELECT * FROM `users`;
+----+----------------+----------------------+----------+---------------------+---------------------+--------+
| id | name           | email                | password | added_date          | modified_date       | status |
+----+----------------+----------------------+----------+---------------------+---------------------+--------+
|  1 | Rasmus Lerdorf | zeev@gmaail.com      | cheers!! | 2014-03-28 10:54:55 | 2014-03-28 11:06:22 | 1      |
|  2 | Vikas Dwivedi  | vikas.nice@gmail.com | cheers!! | 2014-03-28 10:56:06 | 2014-03-28 11:06:22 | 0      |
|  3 | Ramesh Rajwar  | ram@gmail.com        | cheers!! | 2014-03-28 11:00:38 | 2014-03-28 11:06:22 | 1      |
|  4 | Ravi Shankar   | ravi@gmail.com       | cheers!! | 2014-03-28 11:04:36 | 2014-03-28 11:06:22 | 1      |
+----+----------------+----------------------+----------+---------------------+---------------------+--------+
4 rows in set (0.00 sec)

mysql> UPDATE `users` SET `password` = 'mummy'
    -> WHERE `id`='3';
Query OK, 1 row affected (1.69 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM `users`;
+----+----------------+----------------------+----------+---------------------+---------------------+--------+
| id | name           | email                | password | added_date          | modified_date       | status |
+----+----------------+----------------------+----------+---------------------+---------------------+--------+
|  1 | Rasmus Lerdorf | zeev@gmaail.com      | cheers!! | 2014-03-28 10:54:55 | 2014-03-28 11:06:22 | 1      |
|  2 | Vikas Dwivedi  | vikas.nice@gmail.com | cheers!! | 2014-03-28 10:56:06 | 2014-03-28 11:06:22 | 0      |
|  3 | Ramesh Rajwar  | ram@gmail.com        | mummy    | 2014-03-28 11:00:38 | 2014-03-28 11:07:18 | 1      |
|  4 | Ravi Shankar   | ravi@gmail.com       | cheers!! | 2014-03-28 11:04:36 | 2014-03-28 11:06:22 | 1      |
+----+----------------+----------------------+----------+---------------------+---------------------+--------+
4 rows in set (0.00 sec)

mysql> UPDATE `users` SET `password` = 'mummy'
    -> WHERE `id`='3';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0

mysql> DELETE FROM `users`
    -> WHERE `email`='vikas.nice@gmail.com';
Query OK, 1 row affected (0.08 sec)

mysql> SELECT * FROM `users`;
+----+----------------+-----------------+----------+---------------------+---------------------+--------+
| id | name           | email           | password | added_date          | modified_date       | status |
+----+----------------+-----------------+----------+---------------------+---------------------+--------+
|  1 | Rasmus Lerdorf | zeev@gmaail.com | cheers!! | 2014-03-28 10:54:55 | 2014-03-28 11:06:22 | 1      |
|  3 | Ramesh Rajwar  | ram@gmail.com   | mummy    | 2014-03-28 11:00:38 | 2014-03-28 11:07:18 | 1      |
|  4 | Ravi Shankar   | ravi@gmail.com  | cheers!! | 2014-03-28 11:04:36 | 2014-03-28 11:06:22 | 1      |
+----+----------------+-----------------+----------+---------------------+---------------------+--------+
3 rows in set (0.00 sec)

mysql> DELETE FROM `users`;
Query OK, 3 rows affected (0.08 sec)

mysql> SELECT * FROM `users`;
Empty set (0.01 sec)

mysql>
